<?php include "top.php"; ?>
 <?php
		 $nid=make_safe($_GET["nid"]); 
		 $BigClassName=make_safe($_GET["BigClassName"]); 
		 if($nid==""){$nid=1;}
		 
		if($nid==1){$nidname="公司樣本";}
		 if($nid==2){$nidname="禮服";}
		 if($nid==3){$nidname="客戶";}
		 
		 
		?>
      <div id="top-3">
        <div id="m-text-1">
        <table border="0" cellpadding="0" cellspacing="0" class="tab-5">
   <tr>
     <td valign="top"><div class="tab-5-tit">主功能列表</div>
     <div class="m-text-2_btn"><a href="category.php">作品分類管理</a></div>
     
     <div class="tab-5-tit">分類作品管理</div>
     <div class="m-text-2_btn"><a href="working.php">婚紗</a></div>
     <div class="m-text-2_btn"><a href="working.php">婚禮現場</a></div>
     <div class="m-text-2_btn"><a href="working.php">藝術照</a></div>
      <div class="m-text-2_btn"><a href="working.php">寶寶照</a></div>
       <div class="m-text-2_btn"><a href="working.php">產品攝影</a></div>
       </td>
   </tr>
   </table>
        </div>
        <div id="m-text-2_banner">
          <ul>
            <li><a href="#">刪除</a></li>
            <li>/ </li>
            <li><a href="working_list.php">排序</a></li>
            <li>/ </li>
            <li><a href="working_edit.php">修改</a></li>
            <li>/ </li>
            <li><a href="working_add.php">新增相簿</a></li>
            <li>培豪作品管理</li>
          </ul>
        </div><div id="m-text-2"></td>
   </tr>
   </table>
   
   
   
   
      <?php 
   $nid=make_safe($_GET["nid"]); 
   $action=make_safe($_GET["action"]);
    
   $title=make_safe($_GET["title"]); 
   if($title==""){$title=make_safe($_POST["title"]);}
   
   $BigClassName=make_safe($_GET["BigClassName"]);
   if($BigClassName==""){$BigClassName=make_safe($_POST["BigClassName"]);} 
   $addtime=$data3;
   $path = 'upfiles/'. $_FILES['images']['name'];
   $type=strstr($path,'.');
   $path2 ='upfiles/'.$data."1".$type;
   $type=strtolower($type); 
   
   
   $path3 = 'upfiles/'. $_FILES['images2']['name'];
   $type3=strstr($path3,'.');
   $path4 ='upfiles/'.$data."2".$type3;
   $type3=strtolower($type3); 
   
   
   if($action=="add"){
   
   if($type==".jpg"  or $type==".jpge" or $type==".gif" or $type==".doc" or $type==".xls" or $type==".bmp" or $type==".pdf" ){
move_uploaded_file($_FILES['images']['tmp_name'],$path2);
}//上传图片
else
{
$path2="";
}


if($type3==".jpg"  or $type3==".jpge" or $type3==".gif" or $type3==".doc" or $type3==".xls" or $type3==".bmp" or $type3==".pdf" ){
move_uploaded_file($_FILES['images2']['tmp_name'],$path4);
}//上传图片
else
{
$path4="";
}
  
  
   $sql="Insert Into product2 (title,entitle,nid,BigClassName,enBigClassName,addtime,images,images2) Values('$title','$entitle','$nid','$BigClassName','$enBigClassName','$addtime','$path2','$path4')";
$result=mysql_query($sql);

echo "<script> alert('增加成功！');window.location.href='working.php?nid=$nid&BigClassName=$BigClassName';</script>";
   
    }
   
   
   ?>
   
   

   
   
   
   
        <form name="form1" action="?action=add&nid=<?php echo $nid;?>" method="post" enctype="multipart/form-data" target="_self">
        
        <table border="0" cellpadding="0" cellspacing="0" class="m-text-2-imp">
		
		
		<tr>
            <td class="m-text-2-con2">類別：
             
              <input name="BigClassName" type="text" size="30" value="<?php echo $BigClassName?>" /></td>
            </td>
          </tr>
          <tr>
            <td class="m-text-2-con2">相簿名稱：
             
              <input name="title" type="text" id="textfield" size="30" value="<?php echo $title;?>" />
              </td>
            
          </tr>
		  
		  <tr>
            <td class="m-text-2-con2">上傳作品：
             
              <input name="images2" type="file"  size="60"></td>
        
          </tr>
		  
		  
		  
		  <tr>
            <td class="m-text-2-con2"><div align="center">
              <input type="submit" name="Submit" value="提交保存">
            </div></td>
            
          </tr>
        </table>
        </form>
        </div>
      </div>
    </div>
  </div>
</div>
<div id="botton"><div id="copyright"><table border="0" cellpadding="0" cellspacing="0" class="copy">
  <tr>
    <td>© COPYRIGHTS 2010 INC. APARTMENT STUDIO All rights reserved.</td>
  </tr>
</table>
</div></div>
</body>
</html>